<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台分类管理</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="../../static/css/mecss.css" th:href="@{/css/mecss.css}">
</head>
<body>
<!--导航-->
<nav class="ui inverted attached segment m-padded-tb-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">Meteor</h2>
            <a th:href="@{/admin/blogMagt/1}" href="#" class="m-item item m-mobile-hide"><i
                    class="mini home icon m-margin-biaoqian"></i>博客</a>
            <a th:href="@{/type/1}" href="#"  class="active m-item item m-mobile-hide"><i
                    class="mini idea icon m-margin-biaoqian"></i>分类</a>
            <a href="#"  class="m-item item m-mobile-hide"><i
                    class="mini tags icon m-margin-biaoqian"></i>标签</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="mini clone icon m-margin-biaoqian"></i>归档</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="mini info icon m-margin-biaoqian"></i>关于我</a>
            <div class="right m-item m-mobile-hide menu">
                <div class="ui dropdown item">
                    <div class="text">
                        <img  class="ui avatar image" src="https://picsum.photos/800/600?image=1015">
                        <span >Meteor</span>
                    </div>
                    <i class="ui dropdown icon">
                        <div class="menu">
                            <a  href="#" class="item">注销</a>
                        </div>
                    </i>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-top-right m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>
<!--中间内容-->
<div class="m-container-small m-padded-tb-big">
    <div class="ui container">
        <div class="ui success message" >
            <i class="close icon"></i>
            <div class="header">提示：</div>
            <p th:text="${message}">恭喜您，操作成功！</p>
        </div>
        <table class="ui celled table">
            <thead>
            <tr>
                <th></th>
                <th>名称</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody id="tbody">
            <tr th:each="type:${types}" th:fragment="typeList">
                <td th:text="${type.id}">1</td>
                <td th:text="${type.type}">2020-10-11 09:45</td>
                <td>
                    <button href="#"
                       class="ui mini teal basic button" id="bianji">编辑</button>
                    <div class="ui modal bianji">
                        <div class="ui container">
                            <div class="ui raised very padded text container segment rounded">
                                <form th:action="@{/type/update/{id}(id=${type.id})}" method="get">
                                    分类名称修改：<input type="text" name="type">
                                    <button type="submit">提交</button>
                                </form>
                            </div>
                        </div>
                    </div>
                    <a th:href="@{/type/delete/{id}(id=${type.id})}"
                       class="ui mini red basic button">删除</a>
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <th colspan="6">
                    <div class="ui mini pagination menu">
                        <a  class="item" th:href="@{/type/{page}(page=${page.pageNum}-1)}">上一页</a>
                        <a  class="item" th:href="@{/type/{page}(page=${page.pageNum}+1)}">下一页</a>
                    </div>
                    <a href="#" id="xinzeng" class="ui mini right floated teal basic button"
                       style="margin-top:8px">新增</a>
                    <div class="ui modal">
                        <div class="ui container">
                            <div class="ui raised very padded text container segment rounded">
                                 <form th:action="@{/type/add}" method="get">
                                   分类名称新增：<input type="text" name="type">
                                     <button type="submit">提交</button>
                                 </form>
                            </div>
                         </div>
                    </div>
                </th>
            </tr>
            </tfoot>
        </table>
    </div>
</div>
<br>
<br>
<!-- 底部 -->
<footer th:replace="_fragments :: footer" class="ui inverted attached segment m-padded-tb-massive">
    <div class="ui center aligned container">
        <div class="ui inverted divided stackable grid">
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="../../static/image/myvx.jpg" class="ui rounded image" alt="" style="width:100px">
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">关于学习</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">经验分享</a>
                    <a href="#" class="item">酷爱编程</a>
                    <a href="#" class="item">CodingX</a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">关于我</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">喜欢记录</a>
                    <a href="#" class="item">热爱生活</a>
                    <a href="#" class="item">热爱祖国</a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">关于博客</h4>
                <p class="m-text-thin m-text-spaced m-opacity-mini">用来记录生活点滴、编程经验、完善自我技术、发泄情绪的心灵小屋</p>
                <p class="m-text-thin m-text-spaced m-opacity-mini">如果你也热爱编程、并且热爱祖国，可以加入我一起共同进步。</p>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <p class="m-text-thin m-text-spaced m-opacity-tiny">Copright @ 2022 Meteor Designed By </p>
    </div>
</footer>

<th:block th:replace="_fragments :: script">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
</th:block>

<script>
    $(".menu.toggle").click(function () {
        $(".m-item").toggleClass("m-mobile-hide");
    });
    $('.ui.dropdown').dropdown({
        on: 'click',
    });

    //消息提示关闭初始化
    $('.message .close').on('click', function () {
       $(this)
           .closest('.message')
           .transition('fade');
    });

    $('#bianji').click(function () {
        $('.ui.modal.bianji')
            .modal('show')
        ;
    });
    $('#xinzeng').click(function () {
        $('.ui.modal')
            .modal('show')
        ;
    });
</script>
</body>
</html>